<?
	include_once ("../include/conn.php");
	include_once ('config.php');

	/**************************************** 
	*************** 问卷详细数据 ****************
	******************************************/


	//开始数据处理
	$openid = $_GET['openid'];
	$unionid = $_GET['unionid'];
	$qnNo = $_GET['qnNo'];
	// $qnNo = '20190403_opYzGLI8k7sRwOr3cVhn';

	$results = array('code' => 0,'msg'=>'数据正常！');//用于正常有数据输出的

	//////////////////////////// 取出 //////////////////////////
	$cmd = "select * from {$TABLE_C}vote_qn where qn_no='$qnNo'";
	$row = $mydb->fetch_assoc($cmd);

	$results['data']['id'] = intval($row['id']);
	$results['data']['sid'] = intval($row['sid']);
	$results['data']['payment'] = intval($row['payment']);
	$results['data']['qn_no'] = $row['qn_no'];
	$results['data']['openid'] = $row['openid'];
	$results['data']['unionid'] = $row['unionid'];
	$results['data']['service_area'] = $row['service_area'];
	$results['data']['answer_submit'] = $row['answer_submit'];
	$results['data']['answer_result'] = json_decode(preg_replace('/\s+/isU','',$row['answer_result']),true);


	// print_r ($row['answer_result']);
	// echo json_decode($row['answer_result']);
	// echo json_decode($row['answer_result'],true);
	// //////////////////输出数据////////////////////////////////

	echo json_encode($results);

	// 结束
	mysql_close();
?>